--------------------------------- Wireframe Wallhack --------------------------------
function SlobWireFrameOn()
	wireframeenabled = true
	hook.Add("RenderScene", "SlobWireFrameHax", function()
		for _, ent in pairs(ents.GetAll()) do
				if wireframeenabled then
					if RPSlobBotAllowed(ent) then
						ent:SetMaterial("hlmv/debugmrmwireframe")
						ent:SetColor(255, 255, 255, 255)
					end
				end
			if SlobBotAllowed(ent) then
				if !BotVisible(ent) then
					local tc
					if ent:IsPlayer() then
						tc = team.GetColor(ent:Team())
					elseif ent:IsNPC() then
						tc = Color(0, 0, 255, 255)
					end
					ent:SetMaterial("hlmv/debugmrmwireframe")
					ent:SetColor(tc.r, tc.g, tc.b, 255)
				else
					ent:SetMaterial("")
					ent:SetColor(255, 255, 255, 255)
				end
		    end
	    end
    end)
end

concommand.Add("wots_togglewireframe", function()
    if wireframeenabled then
	    hook.Remove("RenderScene", "SlobWireFrameHax")
		for _, ent in pairs(ents.GetAll()) do
	        if RPSlobBotAllowed(ent) then
		    	ent:SetMaterial("")
		    elseif SlobBotAllowed(ent) then
		        ent:SetMaterial("")
                ent:SetColor(255, 255, 255, 255)
		    end
		end
        SlobNotify("WireFrame: OFF")
		wireframeenabled = false
	elseif !wireframeenabled then
        SlobWireFrameOn()
        SlobNotify("WireFrame: ON")
		wireframeenabled = true
    end
end)
------------------------------------------------------------------------------